package interfaz_practica3;

import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;

abstract public class Tablero extends Canvas{

	protected int tamCasilla;
	protected tamTablero tam;
	public enum tamTablero{OCHO, DIEZ, DOCE};
	protected int borde;
	
	public void paint(Graphics g){
		Image fondo = getToolkit().getImage("wooden_background.jpg");
		g.drawImage(fondo,0,0, this);
		pintarCasillas(g,borde,borde);
		pintarExtra(g);
	}
	
	public static int tamToInt(tamTablero tam){
		switch(tam){
		case OCHO:
			return 8;
		case DIEZ:
			return 10;
		case DOCE:
			return 12;
		default:
			return -1;
		}
	}
		
	public int tamToInt(){
		switch(tam){
		case OCHO:
			return 8;
		case DIEZ:
			return 10;
		case DOCE:
			return 12;
		default:
			return -1;
		}
	}
	
	public abstract void pintarCasillas(Graphics g, int iniX, int iniY);
	public abstract void pintarExtra(Graphics g);
	
	public void inicializar(){
		repaint();
	}
	
}